﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonGameClasses;

namespace BattleLogic
{
	public class LogicObject : IWorldObject
	{

		public string Name { get; set; }
		public double PositionX { get; set; }
		public double PositionY { get; set; }
		public double Radius { get; set; }
		public double Rotation { get; set; }
		public TypeWorldObjects TypeWorldObject { get; set; }

		public bool Dead { get; set; }

		public bool CheckForCollisions(IWorldObject obj2)
		{
			double xdif = this.PositionX - obj2.PositionX;
			double ydif = this.PositionY - obj2.PositionY;

			double distance = Math.Sqrt(xdif * xdif + ydif * ydif);

			if (distance <= this.Radius + obj2.Radius)
				return true;

			return false;
		}

		public virtual void Update(double deltaTime)
		{
		}
	}
}
